import React, {useState, useEffect} from 'react'
import { ArrowLeft } from '@react-vant/icons'
import { useNavigate } from 'react-router-dom';
import './index.less'

const Navbar = (props) => {
  const navigate = useNavigate();

  useEffect(() => {
  }, [])

  return (
    <>
      <div className="navbar">
        <div className="navbar-back">
          <ArrowLeft onClick={() => props.url ? navigate(props.url) : navigate(-1)} />
        </div>
        <span>{props.title}</span>
      </div>
    </>
  )
}

export default Navbar;